// 订单管理1
'use strict';
const { Controller } = require('egg');

class cOrdersManage extends Controller {
  // 订单查询
  async pc_c_query() {
    const { ctx } = this;
    const result = await ctx.service.sOrders.pc_s_query(ctx?.query ?? {});
    ctx.body = result;
  }


  //订单更新
  async pc_c_update_orders() {
    console.log('?? - pc_c_update');
    const { ctx } = this;
    const result = await ctx.service.sOrders.pc_s_update_orders(ctx?.request?.body ?? {});
    ctx.body = result;
  }

  // 订单删除
  async pc_c_delete_orders() {
    console.log('?? - pc_c_delete');
    const { ctx } = this;
    const result = await ctx.service.sOrders.pc_s_delete_orders(ctx?.query ?? {});
    ctx.body = result;
  }



  // 查
    async wa_c_queryOrders() {
      const { ctx } = this;
      const result = await ctx.service.sOrders.wa_s_queryOrders(ctx?.query ?? {});
      ctx.body = result;
    }


  //用户订单操作
  async wa_c_operateOrders() {
    console.log('?? - wa_c_operateOrders');
    const { ctx } = this;
    const result = await ctx.service.sOrders.wa_s_operateOrders(ctx?.request?.body ?? {});
    ctx.body = result;
  }

  //用户订单立即支付
  async wa_c_payOrders() {
    console.log('?? - wa_c_payOrders');
    const { ctx } = this;
    const result = await ctx.service.sOrders.wa_s_payOrders(ctx?.request?.body ?? {});
    ctx.body = result;
  }

  //用户订单删除
  async wa_c_delete_orders() {
    console.log('?? - wa_c_delete_orders');
    const { ctx } = this;
    const result = await ctx.service.sOrders.wa_s_delete_orders(ctx?.request?.body ?? {});
    ctx.body = result;
  }





}



module.exports = cOrdersManage;